<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/6/20
 * Time: 21:48
 */

namespace app\common\model;


use think\Model;

class Version extends Base
{

    /**
     * 通过 $appTyep 获取最后一条数据
     * @param string $appType
     * @return false|\PDOStatement|string|\think\Collection
     */
    public function getLastNormalVersionByAppType( $appType = ''){

        $data = [
            'status' => 1,
            'app_type' =>$appType,
        ];
        $order = [
            'id' => 'desc',
        ];
        return $this->where($data)
            ->order($order)
            ->limit(1)
            ->find();
    }

}